<script type="text/javascript" src="/public/fancybox/jquery.fancybox.pack.js" ></script>
<script type="text/javascript" >
function clickReturn(j){
	if(!j){
		//return tip('服务器错误',1,2);
		return;
	}
	if(j.errorcode){
		tip(j.message||j.error,j.errorcode,2);
	}else{
		$(this).find('span').text($(this).data('onum')+1);
	}
	if(j.script){
		new Function(j.script)();
	}
}


function icossetting(){
	$('.icos').addClass('icoenable');
	if(member.mid){
		$('.icos[data-mid='+member.mid+']').removeClass('icoenable');
	}
	
	$('.icos a.ico,.icos span.ico').live('click',function(){
		var icos=$(this).parents('.icos').eq(0);
		var mid=icos.data('mid');
		var wid=icos.data('id');
		var baseurl='<?=site_url('space')?>/';
		if(!mid || !wid)return;
		if(mid==member.mid)return;
		var onum=parseInt($(this).find('span').text());
		$(this).data('onum',onum);
		var self=$(this);
		if(self.is('.icosupport')){
			$.ajax({
				url:baseurl+'workgood/'+mid+'/'+wid,
				dataType:'json',
				success:function(j){
					self.addClass('supported');
					clickReturn.call(self,j)
				}
			});
		}else if(self.is('.icolike')){
	
			$.ajax({
				url:baseurl+'workwatch/'+mid+'/'+wid,
				dataType:'json',
				success:function(j){
					self.addClass('liked');
					clickReturn.call(self,j)
				}
			});
		}else if(self.is('.icocomment')){
			location.href=baseurl+'work/'+mid+'/'+wid;
		}else if(self.is('.icoview')){
			
		}else if(self.is('.icoshare')){
			$.ajax({
				url:baseurl+'workshare/'+mid+'/'+wid,
				dataType:'json',
				success:function(j){
					clickReturn.call(self,j)
				}
			});
		}
	});
	
	
}


icossetting();





$('.commentform').each(function(){
	var ta=$(this).find('textarea');
	var sbtn=$(this).find('.subbtn');
	var oh=sbtn.height();
	ta.focus(function(){
		sbtn.stop(true,false).addClass('hover').animate({bottom:-oh-5});
	}).blur(function(){
		if(ta.val().trim()==''){
			sbtn.stop(true,false).removeClass('hover').animate({bottom:0});
		}
	});
});
$('.fancybox').fancybox();
if(!member.mid){                         //登录弹出框
$('.memberico .icos a').click(function(e){
	e.preventDefault();
	e.stopPropagation();
	$('#ajaxlogin').trigger('click');
});
}
/*
$(".commentlist").each(function() {
	var h_li=$(this).find('li:gt(1)');
	h_li.
    
});*/


$(document).ready(function(){
	var flag=1;
	var flag2=1;
	$("textarea").autoHeight();
	$(".commentlist").each(function(){   //隐藏评论
 		$(this).children('ul').children('li:gt(1)').hide();
	})
	
	$(".more_com").each(function(){   //评论展开
		$(this).bind("click", function() {
		
				if(flag==1){
					$(this).closest('.commentform').next('.commentlist').children('ul').children('li:gt(1)').show();
					flag=2	;
					$(this).html('收起评论>>');
				}else if(flag==2){
					$(this).closest('.commentform').next('.commentlist').children('ul').children('li:gt(1)').hide();
					flag=1	;
					$(this).html('展开更多>>');
				}
				
			});
 		
			
	})
	
	$(".showmore").each(function(){   
		$(this).bind("click", function() {
			if(flag2==1){
				$(this).prev('.story').children(".content").show();
				$(this).prev('.story').children(".subcontent").hide();
				flag2=2	;
				$(this).html('收缩>>');
			}else if(flag2==2){
				$(this).prev('.story').children(".subcontent").show();
				$(this).prev('.story').children(".content").hide();
				flag2=1	;
				$(this).html('展开>>');
			}
		});
	})
	
	$(".recomment").each(function() {  //评论框
		$(this).bind("click",function(){
			var obj=$(this).parent('.info').next('.commentform');
			var showvalue= obj.css('display');
			if(showvalue=='none'){
				obj.show();
			}else{
				obj.hide();	
			}
		})
    });
	
});


</script>
<footer>
	<div class="wrapper">
		<div class="qrcodes weixinqr"><div class="ibox"><img src="/public/images/weixinqr.jpg" alt="SOKERR微信公众号" /></div></div>
		<div class="qrcodes weiboqr"><div class="ibox"><img src="/public/images/weiboqr.png" alt="SOKERR新浪微博" /></div></div>
		<div class="right logo">
			<a href="<?=site_url('/')?>"><img src="<?=$config['site_templateurl'];?>/images/logo_b.png" /></a>
			<a href="javascript:" class="bico weichat"></a>
			<a href="http://weibo.com/u/2201843480" target="_blank" class="bico weibo"></a>
		</div>
		<script type="text/javascript" >
		var qrtime;
		$('footer .weichat').hover(function(){
			clearTimeout(qrtime);
			$('.qrcodes').hide();
			$('.weixinqr').show();
		},function(){
			qrtime=setTimeout(function(){
				$('.qrcodes').hide();
			},1000);
		});
		$('footer .weibo').hover(function(){
			clearTimeout(qrtime);
			$('.qrcodes').hide();
			$('.weiboqr').show();
		},function(){
			qrtime=setTimeout(function(){
				$('.qrcodes').hide();
			},1000);
		});
		$('.qrcodes').hover(function(){
			clearTimeout(qrtime);
		},function(){
			qrtime=setTimeout(function(){
				$('.qrcodes').hide();
			},1000);
		});
		</script>
		<div class="left infos">
			<a href="<?=site_url('category/about')?>" class="blink">关于我们</a>
			<a href="<?=site_url('category/agreement')?>" class="blink" class="blink">条款及条件</a>
			<a href="<?=site_url('category/privacy')?>" class="blink">隐私政策</a>
			<a href="<?=site_url('category/jobs')?>" class="blink">工作机会</a>
			<span>
				Copyright sokerr骚客&nbsp;|&nbsp;<?=date('Y')?>&nbsp;|&nbsp;
			</span>
			<a href="http://www.miitbeian.gov.cn/" target="_blank" rel="nofollow"><?=$config['site_beian']?></a>
            <script type="text/javascript"><!--tongji-->
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Fb5d3831017a2bad28de845e7db1018a1' type='text/javascript'%3E%3C/script%3E"));
</script>

		</div>
		<div class="clear"></div>
	</div>
</footer>